﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using yq.IBase;
using yq.IBase.Basis;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using cn.Util;

namespace yq.Model.Logic
{
    ///<summary>
    /// Sys_FileServer - 文件服务器 - 对象继承类
    /// </summary>
    [Table("Sys_FileServer")]
    [MetadataType(typeof(SysFileServerValidaTion))]
    public class SysFileServer : ModelBase<SysFileServer>
    {

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy)
        {
            this.Sid = dy.Sid;
            this.ServerName = dy.ServerName;
            this.Url = dy.Url;
            this.Path = dy.Path;
            this.IsOpen = dy.IsOpen;
            this.Num = dy.Num;
            this.Version = dy.Version;
        } 

        /// <summary>
        /// 服务ID
        /// </summary>
        private String _Sid = "";


        ///<summary>
        /// 服务ID
        ///</summary>
        [FromDb("Sid", true)]
        public String Sid
        {
            get
            {
                return (this._Sid);
            }

            set
            {
                _Sid = value;
            }
        }







        /// <summary>
        /// 服务名称
        /// </summary>
        private String _ServerName = "";


        ///<summary>
        /// 服务名称
        ///</summary>
        [FromDb("ServerName")]
        public String ServerName
        {
            get
            {
                return (this._ServerName);
            }

            set
            {
                _ServerName = value;
            }
        }







        /// <summary>
        /// 服务Url
        /// </summary>
        private String _Url = "";


        ///<summary>
        /// 服务Url
        ///</summary>
        [FromDb("Url")]
        public String Url
        {
            get
            {
                return (this._Url);
            }

            set
            {
                _Url = value;
            }
        }







        /// <summary>
        /// 是否启用
        /// </summary>
        private int _IsOpen = -1;


        ///<summary>
        /// 是否启用
        ///</summary>
        [FromDb("IsOpen")]
        public int __IsOpen
        {
            get
            {
                return (this._IsOpen);
            }
            set
            {
                _IsOpen = value;
            }
        }

        public yq.Enums.BooleanType IsOpen
        {
            get
            {
                return (yq.Enums.BooleanType)_IsOpen;
            }

            set
            {
                _IsOpen = value.GetHashCode();
            }
        }







        /// <summary>
        /// 文件夹数量
        /// </summary>
        private int _Num = int.MinValue;


        ///<summary>
        /// 文件夹数量
        ///</summary>
        [FromDb("Num")]
        public int Num
        {
            get
            {
                return (this._Num);
            }

            set
            {
                _Num = value;
            }
        }



        private String _WebPath = "";

        [FromDb("WebPath")]
        public String WebPath
        {
            get
            {
                return (this._WebPath);
            }

            set
            {
                _WebPath = value;
            }
        }


        /// <summary>
        /// 文件夹路径
        /// </summary>
        private String _Path = "";


        ///<summary>
        /// 文件夹路径
        ///</summary>
        [FromDb("Path")]
        public String Path
        {
            get
            {
                return (this._Path);
            }

            set
            {
                _Path = value;
            }
        }





        /// <summary>
        /// Version
        /// </summary>
        private String _Version = "";


        ///<summary>
        /// Version
        ///</summary>
        [FromDb("Version")]
        public String Version
        {
            get
            {
                return (this._Version);
            }

            set
            {
                _Version = value;
            }
        }






        ///<summary>
        /// 辅助验证类
        /// </summary>
        [Bind]
        public class SysFileServerValidaTion
        {

            /// <summary>
            /// 服务ID
            /// </summary>
            [Display(Name = "服务ID")]
            [Required]
            [StringLength(36)]
            public String Sid
            { get; set; }


            /// <summary>
            /// 服务名称
            /// </summary>
            [Display(Name = "服务名称")]
            [Required]
            [StringLength(100)]
            public String ServerName
            { get; set; }


            /// <summary>
            /// 服务Url
            /// </summary>
            [Display(Name = "服务Url")]
            [Required]
            [StringLength(200)]
            public String Url
            { get; set; }


            /// <summary>
            /// 是否启用
            /// </summary>
            [Display(Name = "是否启用")]
            [Required]
            [RegularExpression(RegularExpressionString.Int, ErrorMessage = "必须输入数字")]

            public yq.Enums.BooleanType IsOpen
            { get; set; }


            /// <summary>
            /// 文件夹数量
            /// </summary>
            [Display(Name = "文件夹数量")]
            [Required]
            [RegularExpression(RegularExpressionString.Int, ErrorMessage = "必须输入数字")]

            public int Num
            { get; set; }

        }
    }
}